<template>
	<el-container>
		<el-main>
			<el-table :data="tableData" border style="width: 100%">
				<el-table-column prop="id" label="序号" width="180"> </el-table-column>
				<el-table-column prop="name" label="名称"> </el-table-column>
				<el-table-column label="操作" width="100">
					<template slot-scope="scope">
						<el-button @click="viewClick(scope.row)" type="text" size="small">查看</el-button>
					</template>
				</el-table-column>
			</el-table>
		</el-main>
	</el-container>
</template>

<script>
import request from '@/request'

export default {
	data() {
		return {
			tableData: []
		}
	},
	mounted() {
		request({ method: 'get', url: '/close/all', }).then(response=>{
			var data = response.data
			data.forEach(item => {
				item.name = item.name.replace(".txt","")
			});
			this.tableData = data
		})
	},
	methods: {
		viewClick(row){
			this.$router.push(`/ClosePage/${row.id}`)
		}
	},
}
</script>

<style>

</style>